export function useWebSocket() {
    const maxRetries = 3;
    const baseDelay = 1000;

    const connect = async () => {
        for (let i = 0; i < maxRetries; i++) {
            try {
                // 连接逻辑
                return;
            } catch (error) {
                await new Promise(resolve =>
                    setTimeout(resolve, baseDelay * Math.pow(2, i))
                );
            }
        }
        throw new Error('WebSocket connection failed');
    };

    return { connect };
} 